package com.exceptions;/*
 * 功能描述: 建立自定义异常类 -- 继承运行异常最高类
 *
 * */

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class ApiException extends RuntimeException{
    private int code;
    private String msg;

    public ApiException(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public ApiException(ExceptionType exceptionType) {
        this(exceptionType.getCode(), exceptionType.getMsg());
    }
}